package com.yonyou.brigade.order_center.model;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;

import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Time;
import java.util.Date;

/**
 * 机票航班信息
 *
 * @author jiangzhf@yonyou.com
 * @since 2018-07-09
 */
@TableName("bri_flight_info")
public class BriFlightInfo extends Model<BriFlightInfo> implements Comparable<BriFlightInfo> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 订单编号
     */
    @TableField("order_no")
    private String orderNo;
    /**
     * 航司名称
     */
    @TableField("carrier_name")
    private String carrierName;
    /**
     * 出发城市三字码
     */
    @TableField("board_point")
    private String boardPoint;
    /**
     * 出发城市名称
     */
    @TableField("board_point_name")
    private String boardPointName;
    /**
     * 出发城市机场名称
     */
    @TableField("board_point_air_port_name")
    private String boardPointAirPortName;
    /**
     * 出发机场航站楼
     */
    @TableField("board_point_at")
    private String boardPointAt;
    /**
     * 出发日期
     */
    @TableField("departure_date")
    private Date departureDate;
    /**
     * 出发时间
     */
    @TableField("departure_time")
    private Time departureTime;
    /**
     * 到达城市三字码
     */
    @TableField("off_point")
    private String offPoint;
    /**
     * 到达城市
     */
    @TableField("off_point_name")
    private String offPointName;
    /**
     * 到达机场名称
     */
    @TableField("off_point_air_port_name")
    private String offPointAirPortName;
    /**
     * 到达机场航站楼
     */
    @TableField("off_point_at")
    private String offPointAt;
    /**
     * 到达日期
     */
    @TableField("arrive_date")
    private Date arriveDate;
    /**
     * 到达时间
     */
    @TableField("arrive_time")
    private Time arriveTime;
    /**
     * 航班号
     */
    @TableField("flight_no")
    private String flightNo;
    /**
     * 机型
     */
    private String aircraft;
    /**
     * 飞行时间
     */
    @TableField("time_span")
    private String timeSpan;
    /**
     * 退改签
     */
    private String tgq;
    /**
     * 全价
     */
    private String yprice;
    /**
     * 折扣
     */
    @TableField("class_rebate")
    private String classRebate;
    /**
     * 舱位编码
     */
    @TableField("class_code")
    private String classCode;
    /**
     * 舱位等级编码
     */
    @TableField("class_level_code")
    private String classLevelCode;
    /**
     * 舱位等级名称
     */
    @TableField("class_level_name")
    private String classLevelName;
    /**
     * 机票来源,如zhyg中航易购等
     */
    @TableField("from_type")
    private String fromType;
    /**
     * 最低价
     */
    @TableField("lowest_price")
    private BigDecimal lowestPrice;
    /**
     * 燃油费
     */
    @TableField("oilfee")
    private BigDecimal oilfee;
    /**
     * 税/基建费
     */
    @TableField("construction_price")
    private BigDecimal constructionPrice;
    private Date ts;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getCarrierName() {
        return carrierName;
    }

    public void setCarrierName(String carrierName) {
        this.carrierName = carrierName;
    }

    public String getBoardPoint() {
        return boardPoint;
    }

    public void setBoardPoint(String boardPoint) {
        this.boardPoint = boardPoint;
    }

    public String getBoardPointName() {
        return boardPointName;
    }

    public void setBoardPointName(String boardPointName) {
        this.boardPointName = boardPointName;
    }

    public String getBoardPointAirPortName() {
        return boardPointAirPortName;
    }

    public void setBoardPointAirPortName(String boardPointAirPortName) {
        this.boardPointAirPortName = boardPointAirPortName;
    }

    public String getBoardPointAt() {
        return boardPointAt;
    }

    public void setBoardPointAt(String boardPointAt) {
        this.boardPointAt = boardPointAt;
    }

    public Date getDepartureDate() {
        return departureDate;
    }

    public void setDepartureDate(Date departureDate) {
        this.departureDate = departureDate;
    }

    public Time getDepartureTime() {
        return departureTime;
    }

    public void setDepartureTime(Time departureTime) {
        this.departureTime = departureTime;
    }

    public String getOffPoint() {
        return offPoint;
    }

    public void setOffPoint(String offPoint) {
        this.offPoint = offPoint;
    }

    public String getOffPointName() {
        return offPointName;
    }

    public void setOffPointName(String offPointName) {
        this.offPointName = offPointName;
    }

    public String getOffPointAirPortName() {
        return offPointAirPortName;
    }

    public void setOffPointAirPortName(String offPointAirPortName) {
        this.offPointAirPortName = offPointAirPortName;
    }

    public String getOffPointAt() {
        return offPointAt;
    }

    public void setOffPointAt(String offPointAt) {
        this.offPointAt = offPointAt;
    }

    public Date getArriveDate() {
        return arriveDate;
    }

    public void setArriveDate(Date arriveDate) {
        this.arriveDate = arriveDate;
    }

    public Time getArriveTime() {
        return arriveTime;
    }

    public void setArriveTime(Time arriveTime) {
        this.arriveTime = arriveTime;
    }

    public String getFlightNo() {
        return flightNo;
    }

    public void setFlightNo(String flightNo) {
        this.flightNo = flightNo;
    }

    public String getAircraft() {
        return aircraft;
    }

    public void setAircraft(String aircraft) {
        this.aircraft = aircraft;
    }

    public String getTimeSpan() {
        return timeSpan;
    }

    public void setTimeSpan(String timeSpan) {
        this.timeSpan = timeSpan;
    }

    public String getTgq() {
        return tgq;
    }

    public void setTgq(String tgq) {
        this.tgq = tgq;
    }

    public String getYprice() {
        return yprice;
    }

    public void setYprice(String yprice) {
        this.yprice = yprice;
    }

    public String getClassRebate() {
        return classRebate;
    }

    public void setClassRebate(String classRebate) {
        this.classRebate = classRebate;
    }

    public String getClassCode() {
        return classCode;
    }

    public void setClassCode(String classCode) {
        this.classCode = classCode;
    }

    public String getClassLevelCode() {
        return classLevelCode;
    }

    public void setClassLevelCode(String classLevelCode) {
        this.classLevelCode = classLevelCode;
    }

    public String getClassLevelName() {
        return classLevelName;
    }

    public void setClassLevelName(String classLevelName) {
        this.classLevelName = classLevelName;
    }

    public String getFromType() {
        return fromType;
    }

    public void setFromType(String fromType) {
        this.fromType = fromType;
    }

    public BigDecimal getLowestPrice() {
        return lowestPrice;
    }

    public void setLowestPrice(BigDecimal lowestPrice) {
        this.lowestPrice = lowestPrice;
    }

    public Date getTs() {
        return ts;
    }

    public void setTs(Date ts) {
        this.ts = ts;
    }

    public static final String ID = "id";

    public static final String ORDER_NO = "order_no";

    public static final String CARRIER_NAME = "carrier_name";

    public static final String BOARD_POINT = "board_point";

    public static final String BOARD_POINT_NAME = "board_point_name";

    public static final String BOARD_POINT_AIR_PORT_NAME = "board_point_air_port_name";

    public static final String BOARD_POINT_AT = "board_point_at";

    public static final String DEPARTURE_DATE = "departure_date";

    public static final String DEPARTURE_TIME = "departure_time";

    public static final String OFF_POINT = "off_point";

    public static final String OFF_POINT_NAME = "off_point_name";

    public static final String OFF_POINT_AIR_PORT_NAME = "off_point_air_port_name";

    public static final String OFF_POINT_AT = "off_point_at";

    public static final String ARRIVE_DATE = "arrive_date";

    public static final String ARRIVE_TIME = "arrive_time";

    public static final String FLIGHT_NO = "flight_no";

    public static final String AIRCRAFT = "aircraft";

    public static final String TIME_SPAN = "time_span";

    public static final String TGQ = "tgq";

    public static final String YPRICE = "yprice";

    public static final String CLASS_REBATE = "class_rebate";

    public static final String CLASS_CODE = "class_code";

    public static final String CLASS_LEVEL_CODE = "class_level_code";

    public static final String CLASS_LEVEL_NAME = "class_level_name";

    public static final String FROM_TYPE = "from_type";

    public static final String LOWEST_PRICE = "lowest_price";

    public BigDecimal getOilfee() {
        return oilfee;
    }

    public void setOilfee(BigDecimal oilfee) {
        this.oilfee = oilfee;
    }

    public BigDecimal getConstructionPrice() {
        return constructionPrice;
    }

    public void setConstructionPrice(BigDecimal constructionPrice) {
        this.constructionPrice = constructionPrice;
    }

    public static final String TS = "ts";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "BriFlightInfo{" +
                "id=" + id +
                ", orderNo=" + orderNo +
                ", carrierName=" + carrierName +
                ", boardPoint=" + boardPoint +
                ", boardPointName=" + boardPointName +
                ", boardPointAirPortName=" + boardPointAirPortName +
                ", boardPointAt=" + boardPointAt +
                ", departureDate=" + departureDate +
                ", departureTime=" + departureTime +
                ", offPoint=" + offPoint +
                ", offPointName=" + offPointName +
                ", offPointAirPortName=" + offPointAirPortName +
                ", offPointAt=" + offPointAt +
                ", arriveDate=" + arriveDate +
                ", arriveTime=" + arriveTime +
                ", flightNo=" + flightNo +
                ", aircraft=" + aircraft +
                ", timeSpan=" + timeSpan +
                ", tgq=" + tgq +
                ", yprice=" + yprice +
                ", classRebate=" + classRebate +
                ", classCode=" + classCode +
                ", classLevelCode=" + classLevelCode +
                ", classLevelName=" + classLevelName +
                ", fromType=" + fromType +
                ", lowestPrice=" + lowestPrice +
                ", ts=" + ts +
                "}";
    }

    @Override
    public int compareTo(BriFlightInfo briFlightInfo) {
        Date arriveDate = briFlightInfo.getArriveDate();
        Time arriveTime = briFlightInfo.getArriveTime();
        Date arriveDate1 = this.getArriveDate();
        Time arriveTime1 = this.getArriveTime();
        int i = arriveDate1.compareTo(arriveDate);
        if (0 == i) {
            i = arriveTime1.compareTo(arriveTime);
        }
        return i;
    }
}
